package org.cypress.rtpack.common.exception;

public enum ExceptionCode {

	/**
	 * 业务错误以2开头
	 */
	paramError(2001, "Param error"),
	sqlFormatError(2002, "Sql format error"),
	requestBodyFormatError(2003, "Request body format error."),
	requestBodyReadError(2004, "Request body read error."),
	requestParamTypeError(2005, "Request param type error."),
	requestMethodError(2006, "Request method error."),
	callRemoteError(2007, "Call external service error."),
	executeSqlError(2008, "Execute sql error."),
	illegalSensitiveReq(2009, "Illegal request (sensitive words)."),
	duplicatedError(2051,"duplicated"),


	/**
	 * 系统或环境问题以1开头
	 */
	fail(1000, "Internal error"),

	remoteCall(1001, "Remote call error"),
	remoteSvcError(1002, "Remote service error"),
	gdmsSvcNotExists(1003, "gdms-service not exists."),
	connectError(1004, "Connect error.");

	private int code;

	private String desc;

	private ExceptionCode(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
}
